package org.vincen.helloworld.jaxb;

import java.util.ArrayList;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlRootElement;

//@XmlRootElement(namespace="org.vincen.helloworld.jaxb")
@XmlRootElement
public class BookStore {

	private ArrayList<Book> bookList;
	private String name;
	private String location;
	
	//如果将注解用在了bookList成员变量上，这里getBookList将会报重复属性的错。只有将
	//这里的getBookList另取名字如：getBooksList才行。
	@XmlElementWrapper(name="bookList")
	//此处故意和Book类的@XmlRootElement(name="book")注解不同，结果证明：marshal的
	//结果是eachbook
	@XmlElement(name="eachbook")
	public ArrayList<Book> getBookList() {
		return bookList;
	}
	public void setBookList(ArrayList<Book> bookList) {
		this.bookList = bookList;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getLocation() {
		return location;
	}
	public void setLocation(String location) {
		this.location = location;
	}
	
	
}
